Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Jan 25, 2018

Instead of creating CompletionInfo directly, return a union of several kinds and convert to CompletionInfo at the end. This is useful because we won't always want a CompletionInfo (#21374). It also cuts down on code since we were duplicating the code to create CompletionInfo in a lot of places.

Note: Previously, getStringLiteralCompletionEntriesFromCallExpression returned isNewIdentifierLocation: true, but isNewIdentifierLocation: false returned isNewIdentifierLocation: false. In both cases, we are getting the string literal from a contextual type, so I would expect these situations to work the same, and now we return isNewIdentifierLocation: true in both locations. Relevant test completionForStringLiteral3 which tests for this was added in #8428. @mhegazy

@ghost ghost requested review from armanio123 and mhegazy January 25, 2018 21:31
@ghost ghost merged commit ba18337 into master Feb 6, 2018
@ghost ghost deleted the string_completions branch February 6, 2018 20:31
ghost pushed a commit that referenced this pull request Feb 6, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant